<?php

# Display a window to input a new blog entry.

class NewWin {
	static public function display() {
		global $Blog_title, $Blog_text, $Blog_new_win;

		# TODO: is there a method to serialize class static variables?
		$title_label = new Label('title');
		$Blog_title = new Entry(array(
			'widthChars' => 50,
			'maxLength'  => 100
		));

		$text_label = new Label('text with markup');
		# TODO: wrapping control with css2? elastic textarea?
		# http://www.w3schools.com/htmldom/default.asp
		$Blog_text = new Text();

		$save = new Button(array(
			'text'      => 'Save',
			'onClicked' => 'Insert::post()'
		));

		$box = new Box(array(
			'label'       => 'New Blog',
			'orientation' => 'vertical',
			'children'    => array(
				$title_label, $Blog_title,
				$text_label, $Blog_text,
				$save
			)
		));

		Error::trigger('test');
		$Blog_new_win = new Window(array(
			'title'         => 'Giocondo example: new blog',
			'defaultWidth'  => '600',
			'defaultHeight' => '280',
			'child'         => $box
		));
	}
}

# End of file
# vim: set ts=2 sw=2 noet:
?>
